package com.exm.collectcodenew.web.controller;


import com.exm.collectcodenew.web.entity.ChatRequestDto;
import com.exm.collectcodenew.web.service.AnalysisRequestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 解析请求体
 */
@RestController
@RequestMapping("/analysis")
public class AnalysisRequestController {
    @Autowired
    private AnalysisRequestService analysisRequestService;

    /**
     * 解析调用deerflow的python接口的请求Bean，返回下面消息体
     * {"messages":[{"role":"user","content":"Awesome! Let's get started."}],
     *   "thread_id":"BKQ1uZif7SlEYuP1UFZB6","interrupt_feedback":"accepted","auto_accepted_plan":false,
     *  "enable_background_investigation":false,"max_plan_iterations":1,"max_step_num":3,
     *   "max_search_results":3}
     * @param chatRequestDto
     * @return
     */
    @PostMapping("/request")
    public String analysisRequest(@RequestBody ChatRequestDto chatRequestDto){
        return analysisRequestService.analysisRequest(chatRequestDto);
    }

}
